<template>
	<view>
		<p>发现页面</p>
		<uTabber ref="tab"/>
	</view>
</template>

<script>
	import { mapGetters } from 'vuex'
	import uTabber from "@/components/u-tabber/u-tabber.vue"
	
	export default {
		// 引用组件
		components: {
			uTabber
		},
		data() {
			return {
				// 窗口高度
				winHeight: ""
			}
		},
		onLoad() {
			//  高度自适应
			uni.getSystemInfo({
				success: res => {
					this.winHeight = res.windowHeight
				}
			})
			
			// 隐藏底部tabber
			uni.hideTabBar({})
			this.$store.commit('setTabbarName', "find")
		},
		onShow() {
			this.setNavBarColor()
		},
		onReady() {
			// 设置头部导航条
			uni.setNavigationBarTitle({
			    title: this.$t('find')
			})
			this.setNavBarColor()
		},
		computed: {
			...mapGetters(['themeBgColor', 'darkMode']),
		},
		methods: {
			setNavBarColor() {
				// navBar-bg-color
				uni.setNavigationBarColor({
				    frontColor: '#ffffff',
				    backgroundColor: this.themeBgColor,
				    animation: {
				        duration: 400,
				        timingFunc: 'easeIn'
				    }
				})
			},
		}
	}
</script>

<style>

</style>
